﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApp19.Two
{
    /// <summary>  
    /// 具体状态类, 开  
    /// </summary>  
    public class On : LightState
    {
        /// <summary>  
        /// 在开状态下，按下开关则切换到关的状态。  
        /// </summary>  
        /// <param name="light"></param>  
        public override void PressSwich(Light light)
        {
            Console.WriteLine("Turn off the light.");
            light.State = new Off();
        }
    }
}
